import request from "@/utils/request";

export default {
  // 热门直播
  getHotLives(params) {
    return request.get("matches/lives");
  },
  // 获取游戏列表
  getGames() {
    return request.get("public/matchGames");
  },
  // 赛程预告  0 今天  1 明天
  getMatches(time = 0, gameId = 0, page = 1, size = 10) {
    return request.get("public/matches", {
      time,
      gameId,
      page,
      size
    }).then(_ => _.data.data);
  },
  // 历史赛程 0 今天  1 昨天
  getMatchesed(time = 0, gameId = 0, page = 1, size = 10) {
    return request.get("public/matchesEnd", {
      time,
      gameId,
      page,
      size
    }).then(_ => _.data.data);
  },
  // 
  getMatchDetail(id) {
    return request.get("public/matchDetail", {
      id
    });
  },
  // 助威
  // {oddId:int,flower:int,useDebt:boolean}
  postCheer(formData) {
    return request.post("support/support", formData);
  },
  // 获取比赛支持情况
  getMatchSupportDetail(id) {
    return request.get("public/matchSupport", {
      id
    });
  },
  // 助威记录
  getCherrRecord(page = 1, size = 10) {
    return request.get("betOrder/supportOrder", {
      page,
      size
    });
  },
  // 关注比赛
  follow(id) {
    return request.post("user/setFavMatch", {
      id
    });
  },
  // 取消关注
  cancelFollow(id) {
    return request.post("user/cancelFavMatch", {
      id
    });
  },
  // 获取关注的比赛
  getFollowMatch() {
    return request.get("user/favMatches");
  }

};
